package com.lagou.service.impl;

import com.lagou.service.HelloService;
import org.apache.dubbo.config.annotation.Service;

import java.util.concurrent.TimeUnit;

@Service
public class HelloServiceImpl implements HelloService {


   /* public String sayA(String name, int timeToWait) {
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "hello:"+name;
    }*/

    @Override
    public String methodA(String name, int timeToWait) {
        try {
            System.out.println("provider  methodA.......");
            Thread.sleep(Long.valueOf((int)(Math.random()*1000)));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "methodA";
    }

    @Override
    public String methodB(String name, int timeToWait) {
        try {
            System.out.println("provider  methodB.......");

            Thread.sleep(Long.valueOf((int)(Math.random()*1000)));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "methodB";
    }

    @Override
    public String methodC(String name, int timeToWait) {
        try {
            System.out.println("provider  methodC.......");
            Thread.sleep(Long.valueOf((int)(Math.random()*1000)));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "methodC";
    }
}
